<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type='text/javascript' src='http://localhost/dshop/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/dshop/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/dshop/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/dshop/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/dshop/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/dshop';
		WEB = 'http://localhost/dshop/index.php';
		URL = 'http://localhost/dshop/index.php?a=Admin&c=Goods&m=index';
		HDPHP = 'http://localhost/dshop/hdphp/hdphp';
		HDPHPDATA = 'http://localhost/dshop/hdphp/hdphp/Data';
		HDPHPTPL = 'http://localhost/dshop/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/dshop/hdphp/hdphp/Extend';
		APP = 'http://localhost/dshop/index.php?a=Admin';
		CONTROL = 'http://localhost/dshop/index.php?a=Admin&c=Goods';
		METH = 'http://localhost/dshop/index.php?a=Admin&c=Goods&m=index';
		GROUP = 'http://localhost/dshop/hd';
		TPL = 'http://localhost/dshop/hd/Tshop/Admin/Tpl';
		CONTROLTPL = 'http://localhost/dshop/hd/Tshop/Admin/Tpl/Goods';
		STATIC = 'http://localhost/dshop/Static';
		PUBLIC = 'http://localhost/dshop/hd/Tshop/Admin/Tpl/Public';
		HISTORY = 'http://localhost/dshop/index.php?a=Admin&c=Index&m=into';
		HTTPREFERER = 'http://localhost/dshop/index.php?a=Admin&c=Index&m=into';
</script>
</head>
<body>
		<div class="wrap">
	<div class="menu_list">
		<ul>
						<li>
							<a href="<?php echo U('GoodsType/index',array('g_id'=>$_GET['g_id']));?>" class="action"> 
								商品列表
							</a>
						</li>
						<li>
							<a href="<?php echo U('selectCategory');?>">
								添加商品
							</a>
						</li>
						<li>
							<a href="<?php echo U('addBrand');?>">
								添加品牌
							</a>
						</li>
					</ul>
	</div>
	<table class="table2 hd-form">
		<thead>
			<td class="w100">商品gid</td>
			<td >商品名</td>
			<td class="w100">栏目</td>
			<td class="w100">图片</td>
			<td class="w150">操作</td>
		</thead> 
		<?php $hd["list"]["d"]["total"]=0;if(isset($data) && !empty($data)):$_id_d=0;$_index_d=0;$lastd=min(1000,count($data));
$hd["list"]["d"]["first"]=true;
$hd["list"]["d"]["last"]=false;
$_total_d=ceil($lastd/1);$hd["list"]["d"]["total"]=$_total_d;
$_data_d = array_slice($data,0,$lastd);
if(count($_data_d)==0):echo "";
else:
foreach($_data_d as $key=>$d):
if(($_id_d)%1==0):$_id_d++;else:$_id_d++;continue;endif;
$hd["list"]["d"]["index"]=++$_index_d;
if($_index_d>=$_total_d):$hd["list"]["d"]["last"]=true;endif;?>

		<tr>
			<td><?php echo $d['gid'];?></td> 
			<td><?php echo $d['gname'];?></td>
			<td>
				<?php echo $d['cname'];?>
			</td> 
				 	
			<td>
				<img src="http://localhost/dshop/<?php echo $d['list_pic'];?>" alt="<?php echo $d['gname'];?>" class="w50 h50"></td>
			<td>
				<a href="<?php echo U('edit',array('gid'=>$d['gid']));?>">编辑</a> |
				<a href="javascript:if(confirm('确实要删除吗?'))location='<?php echo U('delete',array('gid'=>$d['gid']));?>'">删除</a> 
			</td>
		</tr>

		<?php $hd["list"]["d"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?> 
	</table>
	<div><?php echo $page;?></div>
<div/>
</body> 
</html>